import request from '@/utils/request'

// 查询社区建议列表
export function listSuggestion(query) {
  return request({
    url: '/suggestion/suggestion/list',
    method: 'get',
    params: query
  })
}

// 查询社区建议详细
export function getSuggestion(id) {
  return request({
    url: '/suggestion/suggestion/' + id,
    method: 'get'
  })
}

// 新增社区建议
export function addSuggestion(data) {
  return request({
    url: '/suggestion/suggestion',
    method: 'post',
    data: data
  })
}

// 获取仪表盘统计
export function getDashboardStats() {
  return request({
    url: '/suggestion/suggestion/dashboard',
    method: 'get'
  })
}

// 修改社区建议
export function updateSuggestion(data) {
  return request({
    url: '/suggestion/suggestion',
    method: 'put',
    data: data
  })
}

// 删除社区建议
export function delSuggestion(id) {
  return request({
    url: '/suggestion/suggestion/' + id,
    method: 'delete'
  })
}


//投票信息
// 获取仪表盘统计
export function suggestVote() {
  return request({
    url: '/suggestion/suggestion/suggestVote',
    method: 'get'
  })
}
